package lovo01.lesson04;

/**
 * 士兵类
 */
public class Soldier extends Role{
    public Soldier() {
    }

    public Soldier(String name, int level) {
        super(name, level);
    }

    /**
     * 防御
     */
    public void defend(Farmer farmer,Robber robber){
        System.out.println("防御了" + farmer.getName() + "和" + robber.getName() + "的攻击");
    }

    @Override
    void selfIntroduce() {
        System.out.println("我是：" + this.getName() + "，目前等级是："
                + getLevel() + "级" + ",是一位士兵");
    }
}
